package pers.xiaoliang.concurrency.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.concurrent.atomic.AtomicInteger;

/**
* @description: 测试接口的控制器
* @author: xiaoliang.liu
* @date: 2018/7/27 21:29
* @version v1.0
*/
@Slf4j
@Controller
public class TestController {

    private AtomicInteger index = new AtomicInteger();

    /**
     * 测试接口
     * @return String
     */
    @GetMapping("/test")
    @ResponseBody
    public String test() {
        int i = index.incrementAndGet();
        System.out.println(i);
        return "hello concurrency";
    }
}
